<template>
  <div class="el-loading-mask">
    <div class="el-loading-icon"></div>
  </div>
</template>

<script>
/*eslint-disable*/
export default {
  mounted() {
    // 组件加载后立即执行旋转动画
    this.startRotation();
  },
  methods: {
    startRotation() {
      const icon = this.$el.querySelector(".el-loading-icon");
      icon.style.animation = "rotate 2s linear infinite"; // 旋转动画，可根据需要调整
    },
  },
};
</script>

<style scoped>
.el-loading-mask {
  position: relative;
  margin-left: -30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.el-loading-icon {
  width: 20px;
  height: 20px;
  background: url("../../assets/images/icon/selectResult/loading.png") center
    center no-repeat; /* 替换为加载图标的路径 */
  background-size: contain; /* 调整图标大小 */
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>
